class InitialSchema < ActiveRecord::Migration
  def self.up
  
    create_table "bikes", :force => true do |t|
      t.column "name", :string, :limit => 24, :default => "", :null => false
      t.column "description", :text
      t.column "created_on", :timestamp
      t.column "updated_on", :timestamp
    end
  
    create_table "ride_elements", :force => true do |t|
      t.column "name", :string, :limit => 24, :default => "", :null => false
      t.column "description", :text
      t.column "comments", :text
      t.column "created_on", :timestamp
      t.column "updated_on", :timestamp
    end
  
    create_table "ride_elements_rides", :force => true do |t|
      t.column "ride_id", :integer, :limit => 9, :default => 0, :null => false
      t.column "ride_element_id", :integer, :limit => 9, :default => 0, :null => false
      t.column "position", :integer, :limit => 3, :default => 0, :null => false
    end
  
    add_index "ride_elements_rides", ["id"], :name => "id"
  
    create_table "rides", :force => true do |t|
      t.column "distance", :integer, :limit => 4, :default => 0, :null => false
      t.column "time", :string, :limit => 4
      t.column "average_speed", :string, :limit => 4
      t.column "bike_id", :integer, :limit => 4, :default => 0, :null => false
      t.column "ride_on", :date, :null => false
      t.column "created_on", :timestamp
      t.column "updated_on", :timestamp
    end
  
    add_index "rides", ["bike_id"], :name => "bike_id"
  
  end

  def self.down
  end
end
